#include <any>
#include <map>
#include <string>
#include <vector>
#include <iostream>

struct Event {
    std::string type;
    std::any data;
};

void process_event(const Event& event) {
    if (event.type == "int") {
        std::cout << "Processing int event with data: " << std::any_cast<int>(event.data) << '\n';
    } else if (event.type == "string") {
        std::cout << "Processing string event with data: " << std::any_cast<std::string>(event.data) << '\n';
    }
}

int main() {
    std::vector<Event> events = {
        {"int", 42},
        {"string", std::string("Hello, world!")}
    };

    for (const auto& event : events) {
        process_event(event);
    }
}